from selenium.webdriver.common.by import By
from Base import Base
from time import sleep

class Page(Base):
    login_py = (By.XPATH,'/html/body/div[1]/div/div[2]/ul/li[1]/a')
    def login(self):
        self.click(self.login_py)
    dy1_py = (By.XPATH,'/html/body/div[4]/div/div[1]/div[1]/span[1]')
    def dy1(self):
        return self.text(self.dy1_py)
    username_py = (By.NAME,'username')
    def username(self):
        self.send_keys(self.username_py,'lkx')
    password_py = (By.NAME,'password')
    def password(self):
        self.send_keys(self.password_py,'123456')
    djlogin_py = (By.XPATH,'//*[@id="theForm"]/div[5]/a')
    def djlogin(self):
        self.click(self.djlogin_py)
    dy2_py = (By.XPATH,'/html/body/div[1]/div/div[2]/ul/li[1]/a')
    def dy2(self):
        return self.text(self.dy2_py)

    def test_A3mall_01(self):
        self.get_url('http://10.59.9.12:7001/')
        sleep(3)
        self.login()
        sleep(3)
        print(self.dy1())
        self.username()
        self.password()
        sleep(10)
        self.djlogin()
        sleep(10)
        self.dy2()